﻿<html>
	<head>
		<title>ECOTree Simple Tree 1</title>
		  <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" />
		  <script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script>
		  <script type="text/javascript" src="extjs/ext-all.js"></script>
			<script type="text/javascript" src="js/ECOTree.js"></script>
			<link type="text/css" rel="stylesheet" href="css/ECOTree.css" />
			<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v"/>
			<style>v\:*{ behavior:url(#default#VML);}</style> 
		
			
		<script language='Javascript'>
		
			/*
			Ext.QuickTips.init();
			
			var test = "总部<br>192.168.1.1<br><a href='javascript:void(null)' onclick='javascript:Ext.MessageBox.alert(\"详细信息\", \"XXX有限公司<BR>地址：XXXXX<BR>联系人：XXX<BR>电话：XXX\");'>查看</a>";
			
		
			Ext.onReady(function()
			{
			 
					var myData=[
						[1,-1,test],
						[2,1,'上海服务器<br>192.168.1.1'],
						[3,1,'北京服务器<br>192.168.2.1'],
						[4,2,'上海服务器1<br>192.168.3.1'],
						[5,2,'上海服务器2<br>192.168.4.1'],
						[6,3,'北京服务器1<br>192.168.5.1'],
						[7,3,'北京服务器2<br>192.168.6.1'],
						[8,-1,'海外分部<br>192.168.7.7'],
						[9,8,'美国服务器<br>192.168.8.1'],
						[10,8,'欧洲服务器<br>192.168.9.1']
					];
				CreateTree(myData);	
			}
		);
		
			var myTree = null;
			var myData;
			
			function CreateTree(data) {
				myTree = new ECOTree('myTree','myTreeContainer');							
				for(var i = 0 ; i < data.length ; i ++){
					myTree.add(data[i][0],data[i][1],data[i][2],170,50);
				}
				myData = data;
				myTree.config.selectMode = 1;
				myTree.config.useTarget = false;
				
				myTree.UpdateTree();
			}
			function GetSel(){
				var rtn = ['',''];
				var selnodes = myTree.getSelectedNodes();
				if(selnodes.length <= 0){
					alert('请选择一个服务器');
					return '';
				}else{
					for(var i = 0 ; i < myData.length ; i ++){
						if(selnodes[0].id == myData[i][0]){
							rtn[0] = myData[i][0];
							rtn[1] = myData[i][3];
							return rtn;
						}
					}
					return '';
				}
				
			}			*/
		</script>			
	</head>
	<body>
		<div id="myTreeContainer">
			<img src="images/test1.JPG"/>
		</div>
	</body>
</html>